Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

conflictResolution value is not taken in account if labelYOffset is set #969

Closed
svareg opened this issue Jun 7, 2019 · 1 comment
Closed
Assignees

Comments

@svareg
Copy link

svareg commented Jun 7, 2019

Context

  • MapFish print version: 3.18.2
  • Java version: 1.8.0 (Oracle version)
  • OS: Debian Stretch

Describe the bug

When using a Label symbolizer, the property conflictResolution=false is not taken in account if the property labelYOffset is set to a integer bigger than 0.

How to reproduce

With this first json:

{
    "app": "mapbs",
    "outputFormat": "png",
    "layout": "A4 Hochformat",
    "format": "png",
    "attributes": {
        "scale": 1000,
        "maxTitleLength": "80",
        "requestHeaders": {
            "requestHeaders": {
                "content-type": [
                    "application/json; charset=UTF-8"
                ],
                "x-b3-spanid": [
                    "5595caa5aec4824a"
                ],
                "x-istio-attributes": [
                    "CjMKGGRlc3RpbmF0aW9uLnNlcnZpY2UuaG9zdBIXEhVidmRnZGktc3ZkbWJhcDIuYnMuY2gKMwoYZGVzdGluYXRpb24uc2VydmljZS5uYW1lEhcSFWJ2ZGdkaS1zdmRtYmFwMi5icy5jaAoqCh1kZXN0aW5hdGlvbi5zZXJ2aWNlLm5hbWVzcGFjZRIJEgdkZWZhdWx0Ci4KE2Rlc3RpbmF0aW9uLnNlcnZpY2USFxIVYnZkZ2RpLXN2ZG1iYXAyLmJzLmNoCk8KCnNvdXJjZS51aWQSQRI/a3ViZXJuZXRlczovL2lzdGlvLWluZ3Jlc3NnYXRld2F5LTZmNTQ2OGZmYzktMmoyNmguaXN0aW8tc3lzdGVt"
                ],
                "accept-language": [
                    "de,en-US;q=0.7,en;q=0.3"
                ],
                "host": [
                    "map.geo.dev.bs.ch"
                ],
                "x-forwarded-for": [
                    "10.42.4.0"
                ],
                "accept": [
                    "application/json, text/plain, */*"
                ],
                "x-envoy-decorator-operation": [
                    "bvdgdi-svdmbap2.bs.ch:80/*"
                ],
                "te": [
                    "trailers"
                ],
                "user-agent": [
                    "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:67.0) Gecko/20100101 Firefox/67.0"
                ],
                "x-request-id": [
                    "bc91692b-1f31-4220-81e4-25d148ab93e5"
                ],
                "x-b3-traceid": [
                    "5595caa5aec4824a"
                ],
                "x-forwarded-proto": [
                    "https"
                ],
                "x-envoy-internal": [
                    "true"
                ],
                "cache-control": [
                    "no-cache"
                ],
                "cookie": [
                    "_pk_id.84.6428=2065899ef9b03ad0.1544686652.2.1544706137.1544705563.; AL_SESS-S=AZKUQBp6xyuz5NYW9Dulbs4hkSfjsitso2dcWkZCuwDX7nLzIPRxFYntTFukShH6apYj; AL_LB=$xc/GsIaerqoCH6abhJUNKphSEGRJYBVHKnC0xGk57Hm389fXSV3; AL_SESS=AU59TIaNx2aNNoD5oSrX8wrkafUYcLuAXZ6M4Te9VlOBTf0n2FXX3VVXOVIl8gHWPcX2; WEBROUTEID=.1; SRV=srv4; auth_tkt_mapbs_dev=52ca59af40f7487ada2e5ec06c19cccffa2de73c4921044b0874996578aa80c7a4f192b16d77170c1f5d3361d4430c00491e8cd0be7ef7be253020997d129f545cf6607cc3ZhcmVneA%3D%3D!userid_type:b64unicode; auth_tkt_mapbs_dev=52ca59af40f7487ada2e5ec06c19cccffa2de73c4921044b0874996578aa80c7a4f192b16d77170c1f5d3361d4430c00491e8cd0be7ef7be253020997d129f545cf6607cc3ZhcmVneA%3D%3D!userid_type:b64unicode"
                ],
                "x-b3-sampled": [
                    "0"
                ],
                "content-length": [
                    "6615"
                ],
                "accept-encoding": [
                    "gzip, deflate, br"
                ],
                "referer": [
                    "https://map.geo.dev.bs.ch/svareg/?lang=de&baselayer_ref=blank&map_x=2612746&map_y=1269372&map_zoom=8&rl_features=Fa(1kvuj-fkt7TzG2-gFr-gHt-pK6_g7-pAj-YN4!R8*3_DV7-kPy_bFu-fP1!s*7_7Cw-sRb!~n*Polygon%25201%27c*%2523DB4436%27a*0%27o*0.2%27m*true%27b*false%27s*10%27k*2)a(nnsuj-54t7T2-RaAJeAQrOj_6Sx_t3!cJ-2*f-t_f-v-1*Zf!D3Cs-9Bw-b!s-b_5_dHh_dP1!yCJsDL1Fy-kEb-dC_1Gq_sFHuD0qA1-hEd-9-Wy-F~n*Polygon%25202%27c*%2523DB4436%27a*0%27o*0.2%27m*true%27b*false%27s*10%27k*2)a(9tmuj-bgs7TPxA5-r_4-J8_Rm!Zv!EcE8-8AYpK8_cF*2Xx!Bv-g!Km!Oa!e-vBg!4*t-x*WtEc-aLGBzGTe*d-x_NWr-a-vL3T8*d_8_q_y_*h_g-bx!1N~n*Polygon%25203%27c*%2523DB4436%27a*0%27o*0.2%27m*true%27b*false%27s*10%27k*2)a(3yruj-5us7TjC!eB-zFp_pC-eE8-zEz-mL6-2V6*aB2-6_g-kZf*5Nf_sDVfIXqD1-nC7-wEw-~n*Polygon%25204%27c*%2523DB4436%27a*0%27o*0.2%27m*true%27b*false%27s*10%27k*2)&tree_enable_OF_Orthofoto2015April=false&tree_opacity_OF_Orthofoto2015April=0.69&tree_enable_OF_Orthofoto2010April=false&tree_enable_ch.swisstopo.swissimage-product-2011=false&tree_enable_OF_Orthofoto2012Maerz=false&tree_enable_OF_Orthofoto2012Juli=false&tree_enable_ch.swisstopo.swissimage-product-2014=false&tree_enable_OF_Orthofoto2017Maerz=false&tree_enable_OF_TrueOrthofoto2017Maerz=false&tree_enable_ch.swisstopo.swissimage-product=false&tree_groups=Luftmessstationen%20und%20Jahresmittelwerte%2CRaumbewirtschaftung%20Immobilien%20Basel-Stadt%2CLuft%2CAdministrative%20Einteilung%20Forstwirtschaft%2CLiegenschaften%2COrthofotos%20(ab%202010)&tree_group_layers_Luftmessstationen%20und%20Jahresmittelwerte=&tree_group_layers_Raumbewirtschaftung%20Immobilien%20Basel-Stadt=&tree_group_layers_Luft=&tree_group_layers_Administrative%20Einteilung%20Forstwirtschaft=&tree_group_layers_Liegenschaften="
                ]
            }
        },
        "disclaimer": "",
        "rotation": 0,
        "maxCommentLength": "120",
        "map": {
            "center": [
                2612746.125000001,
                1269371.875
            ],
            "scale": 1000,
            "rotation": 0,
            "projection": "EPSG:2056",
            "layers": [
                {
                    "style": {
                        "[_ngeo_style_0 = '1948']": {
                            "symbolizers": [
                                {
                                    "fillColor": "#db4436",
                                    "type": "polygon",
                                    "strokeColor": "#db4436",
                                    "fillOpacity": 0.2,
                                    "strokeOpacity": 1,
                                    "strokeWidth": 2
                                }
                            ]
                        },
                        "[_ngeo_style_1 = '1943']": {
                            "symbolizers": [
                                {
                                    "haloOpacity": 1,
                                    "fontColor": "#333333",
                                    "haloRadius": 1.5,
                                    "haloColor": "#ffffff",
                                    "label": "1'450 m²",
                                    "fontSize": "10pt",
                                    "type": "Text",
                                    "fontWeight": "normal",
                                    "conflictResolution": false,
                                    "labelXOffset": 0,
                                    "labelAlign": "cm",
                                    "fontFamily": "Arial",
                                    "labelYOffset": 8
                                }
                            ]
                        },
                        "[_ngeo_style_0 = '1946']": {
                            "symbolizers": [
                                {
                                    "fillColor": "#db4436",
                                    "type": "polygon",
                                    "strokeColor": "#db4436",
                                    "fillOpacity": 0.2,
                                    "strokeOpacity": 1,
                                    "strokeWidth": 2
                                }
                            ]
                        },
                        "[_ngeo_style_0 = '1942']": {
                            "symbolizers": [
                                {
                                    "fillColor": "#db4436",
                                    "type": "polygon",
                                    "strokeColor": "#db4436",
                                    "fillOpacity": 0.2,
                                    "strokeOpacity": 1,
                                    "strokeWidth": 2
                                }
                            ]
                        },
                        "[_ngeo_style_1 = '1947']": {
                            "symbolizers": [
                                {
                                    "haloOpacity": 1,
                                    "fontColor": "#333333",
                                    "haloRadius": 1.5,
                                    "haloColor": "#ffffff",
                                    "label": "2'900 m²",
                                    "fontSize": "10pt",
                                    "type": "Text",
                                    "fontWeight": "normal",
                                    "conflictResolution": false,
                                    "labelXOffset": 0,
                                    "labelAlign": "cm",
                                    "fontFamily": "Arial",
                                    "labelYOffset": 8
                                }
                            ]
                        },
                        "[_ngeo_style_1 = '1949']": {
                            "symbolizers": [
                                {
                                    "haloOpacity": 1,
                                    "fontColor": "#333333",
                                    "haloRadius": 1.5,
                                    "haloColor": "#ffffff",
                                    "label": "434 m²",
                                    "fontSize": "10pt",
                                    "type": "Text",
                                    "fontWeight": "normal",
                                    "conflictResolution": false,
                                    "labelXOffset": 0,
                                    "labelAlign": "cm",
                                    "fontFamily": "Arial",
                                    "labelYOffset": 8
                                }
                            ]
                        },
                        "[_ngeo_style_0 = '1944']": {
                            "symbolizers": [
                                {
                                    "fillColor": "#db4436",
                                    "type": "polygon",
                                    "strokeColor": "#db4436",
                                    "fillOpacity": 0.2,
                                    "strokeOpacity": 1,
                                    "strokeWidth": 2
                                }
                            ]
                        },
                        "[_ngeo_style_1 = '1945']": {
                            "symbolizers": [
                                {
                                    "haloOpacity": 1,
                                    "fontColor": "#333333",
                                    "haloRadius": 1.5,
                                    "haloColor": "#ffffff",
                                    "label": "2'150 m²",
                                    "fontSize": "10pt",
                                    "type": "Text",
                                    "fontWeight": "normal",
                                    "conflictResolution": false,
                                    "labelXOffset": 0,
                                    "labelAlign": "cm",
                                    "fontFamily": "Arial",
                                    "labelYOffset": 8
                                }
                            ]
                        },
                        "version": 2
                    },
                    "opacity": 1,
                    "geoJson": {
                        "features": [
                            {
                                "properties": {
                                    "_ngeo_style_0": "1942",
                                    "_ngeo_style_1": "1943",
                                    "s": 10,
                                    "b": false,
                                    "c": "#DB4436",
                                    "a": 0,
                                    "n": "Polygon 1",
                                    "o": 0.2,
                                    "m": true,
                                    "k": 2
                                },
                                "type": "Feature",
                                "geometry": {
                                    "type": "Polygon",
                                    "coordinates": [
                                        [
                                            [
                                                2613020.8000000003,
                                                1269431.1
                                            ],
                                            [
                                                2613001.6,
                                                1269429.4000000001
                                            ],
                                            [
                                                2612984.8000000003,
                                                1269426.6
                                            ],
                                            [
                                                2612964.8000000003,
                                                1269423.7000000002
                                            ],
                                            [
                                                2612939.7,
                                                1269420.2000000002
                                            ],
                                            [
                                                2612878.1,
                                                1269411.1
                                            ],
                                            [
                                                2612875.6,
                                                1269409.6
                                            ],
                                            [
                                                2612876.5,
                                                1269404.6
                                            ],
                                            [
                                                2612877.6,
                                                1269397.8
                                            ],
                                            [
                                                2612880.9000000004,
                                                1269398.2000000002
                                            ],
                                            [
                                                2612882.2,
                                                1269400.1
                                            ],
                                            [
                                                2612915.1,
                                                1269404.8
                                            ],
                                            [
                                                2612931.6,
                                                1269407.7000000002
                                            ],
                                            [
                                                2612964.3000000003,
                                                1269412.5
                                            ],
                                            [
                                                2612971.9000000004,
                                                1269416
                                            ],
                                            [
                                                2612983.4000000004,
                                                1269419
                                            ],
                                            [
                                                2613019.8000000003,
                                                1269424.3
                                            ],
                                            [
                                                2613020.8000000003,
                                                1269431.1
                                            ]
                                        ]
                                    ]
                                }
                            },
                            {
                                "properties": {
                                    "_ngeo_style_0": "1944",
                                    "_ngeo_style_1": "1945",
                                    "s": 10,
                                    "b": false,
                                    "c": "#DB4436",
                                    "a": 0,
                                    "n": "Polygon 2",
                                    "o": 0.2,
                                    "m": true,
                                    "k": 2
                                },
                                "type": "Feature",
                                "geometry": {
                                    "type": "Polygon",
                                    "coordinates": [
                                        [
                                            [
                                                2612871.4000000004,
                                                1269406.6
                                            ],
                                            [
                                                2612869.7,
                                                1269407.7000000002
                                            ],
                                            [
                                                2612861.2,
                                                1269408.4000000001
                                            ],
                                            [
                                                2612852.5,
                                                1269407.3
                                            ],
                                            [
                                                2612820.9000000004,
                                                1269403.2000000002
                                            ],
                                            [
                                                2612783.8000000003,
                                                1269398.5
                                            ],
                                            [
                                                2612625.7,
                                                1269375.5
                                            ],
                                            [
                                                2612625.6,
                                                1269369
                                            ],
                                            [
                                                2612627.9000000004,
                                                1269364.5
                                            ],
                                            [
                                                2612630.2,
                                                1269361.5
                                            ],
                                            [
                                                2612636.6,
                                                1269363
                                            ],
                                            [
                                                2612642.1,
                                                1269363.4000000001
                                            ],
                                            [
                                                2612653.4000000004,
                                                1269366.2000000002
                                            ],
                                            [
                                                2612663.4000000004,
                                                1269369.2000000002
                                            ],
                                            [
                                                2612668.7,
                                                1269372
                                            ],
                                            [
                                                2612672.4000000004,
                                                1269375.4000000001
                                            ],
                                            [
                                                2612692.2,
                                                1269379.4000000001
                                            ],
                                            [
                                                2612724.8000000003,
                                                1269384.2000000002
                                            ],
                                            [
                                                2612737.5,
                                                1269384.9000000001
                                            ],
                                            [
                                                2612751.5,
                                                1269385.7000000002
                                            ],
                                            [
                                                2612767.5,
                                                1269388.8
                                            ],
                                            [
                                                2612782.8000000003,
                                                1269390.9000000001
                                            ],
                                            [
                                                2612794.6,
                                                1269391
                                            ],
                                            [
                                                2612812.2,
                                                1269395.3
                                            ],
                                            [
                                                2612829.4000000004,
                                                1269395.9000000001
                                            ],
                                            [
                                                2612843.5,
                                                1269394.3
                                            ],
                                            [
                                                2612852.6,
                                                1269395.9000000001
                                            ],
                                            [
                                                2612867.8000000003,
                                                1269398.1
                                            ],
                                            [
                                                2612869.8000000003,
                                                1269396.7000000002
                                            ],
                                            [
                                                2612872.9000000004,
                                                1269397.2000000002
                                            ],
                                            [
                                                2612871.4000000004,
                                                1269406.6
                                            ]
                                        ]
                                    ]
                                }
                            },
                            {
                                "properties": {
                                    "_ngeo_style_0": "1946",
                                    "_ngeo_style_1": "1947",
                                    "s": 10,
                                    "b": false,
                                    "c": "#DB4436",
                                    "a": 0,
                                    "n": "Polygon 3",
                                    "o": 0.2,
                                    "m": true,
                                    "k": 2
                                },
                                "type": "Feature",
                                "geometry": {
                                    "type": "Polygon",
                                    "coordinates": [
                                        [
                                            [
                                                2612622.8000000003,
                                                1269374.9000000001
                                            ],
                                            [
                                                2612623.8000000003,
                                                1269365.4000000001
                                            ],
                                            [
                                                2612625.6,
                                                1269361
                                            ],
                                            [
                                                2612623.8000000003,
                                                1269361.7000000002
                                            ],
                                            [
                                                2612620.2,
                                                1269362.8
                                            ],
                                            [
                                                2612614.4000000004,
                                                1269364.3
                                            ],
                                            [
                                                2612608.2,
                                                1269363.8
                                            ],
                                            [
                                                2612593.2,
                                                1269361.8
                                            ],
                                            [
                                                2612584.8000000003,
                                                1269360.3
                                            ],
                                            [
                                                2612559.7,
                                                1269356.7000000002
                                            ],
                                            [
                                                2612543.1,
                                                1269356.9000000001
                                            ],
                                            [
                                                2612498.2,
                                                1269350.6
                                            ],
                                            [
                                                2612498.5,
                                                1269347.6
                                            ],
                                            [
                                                2612492.9000000004,
                                                1269346.8
                                            ],
                                            [
                                                2612487.1,
                                                1269345.8
                                            ],
                                            [
                                                2612481.8000000003,
                                                1269343.5
                                            ],
                                            [
                                                2612470.8000000003,
                                                1269337.9000000001
                                            ],
                                            [
                                                2612464.2,
                                                1269335
                                            ],
                                            [
                                                2612456.3000000003,
                                                1269333.6
                                            ],
                                            [
                                                2612440.6,
                                                1269331.4000000001
                                            ],
                                            [
                                                2612414.5,
                                                1269330.8
                                            ],
                                            [
                                                2612414.8000000003,
                                                1269311.6
                                            ],
                                            [
                                                2612416,
                                                1269304.5
                                            ],
                                            [
                                                2612418.2,
                                                1269299.8
                                            ],
                                            [
                                                2612419.1,
                                                1269298.4000000001
                                            ],
                                            [
                                                2612416.3000000003,
                                                1269296.3
                                            ],
                                            [
                                                2612389.3000000003,
                                                1269334.8
                                            ],
                                            [
                                                2612382.5,
                                                1269338.6
                                            ],
                                            [
                                                2612378.9000000004,
                                                1269342.9000000001
                                            ],
                                            [
                                                2612383.6,
                                                1269343.1
                                            ],
                                            [
                                                2612387.6,
                                                1269340.7000000002
                                            ],
                                            [
                                                2612588.1,
                                                1269369.5
                                            ],
                                            [
                                                2612622.8000000003,
                                                1269374.9000000001
                                            ]
                                        ]
                                    ]
                                }
                            },
                            {
                                "properties": {
                                    "_ngeo_style_0": "1948",
                                    "_ngeo_style_1": "1949",
                                    "s": 10,
                                    "b": false,
                                    "c": "#DB4436",
                                    "a": 0,
                                    "n": "Polygon 4",
                                    "o": 0.2,
                                    "m": true,
                                    "k": 2
                                },
                                "type": "Feature",
                                "geometry": {
                                    "type": "Polygon",
                                    "coordinates": [
                                        [
                                            [
                                                2612835.3000000003,
                                                1269392.2000000002
                                            ],
                                            [
                                                2612823.2,
                                                1269392
                                            ],
                                            [
                                                2612812.9000000004,
                                                1269391.9000000001
                                            ],
                                            [
                                                2612795.3000000003,
                                                1269387.6
                                            ],
                                            [
                                                2612783,
                                                1269387.5
                                            ],
                                            [
                                                2612767.9000000004,
                                                1269385.5
                                            ],
                                            [
                                                2612751.9000000004,
                                                1269382.3
                                            ],
                                            [
                                                2612725.3000000003,
                                                1269380.4000000001
                                            ],
                                            [
                                                2612683.6,
                                                1269373.7000000002
                                            ],
                                            [
                                                2612673.5,
                                                1269372
                                            ],
                                            [
                                                2612670,
                                                1269369.6
                                            ],
                                            [
                                                2612718.9000000004,
                                                1269376.7000000002
                                            ],
                                            [
                                                2612747.9000000004,
                                                1269380.6
                                            ],
                                            [
                                                2612761.9000000004,
                                                1269381.9000000001
                                            ],
                                            [
                                                2612783.4000000004,
                                                1269383.3
                                            ],
                                            [
                                                2612797.3000000003,
                                                1269384.9000000001
                                            ],
                                            [
                                                2612809.5,
                                                1269386.8
                                            ],
                                            [
                                                2612825.3000000003,
                                                1269389.8
                                            ],
                                            [
                                                2612835.3000000003,
                                                1269392.2000000002
                                            ]
                                        ]
                                    ]
                                }
                            }
                        ],
                        "type": "FeatureCollection"
                    },
                    "type": "geojson"
                }
            ],
            "dpi": 254
        },
        "lang": "de",
        "datasource": []
    }
}

The result is the following:

grafik

With this second json (I only changed the value of labelYOffset for 2 symbolizers):

{
    "app": "mapbs",
    "outputFormat": "png",
    "layout": "A4 Hochformat",
    "format": "png",
    "attributes": {
        "scale": 1000,
        "maxTitleLength": "80",
        "requestHeaders": {
            "requestHeaders": {
                "content-type": [
                    "application/json; charset=UTF-8"
                ],
                "x-b3-spanid": [
                    "5595caa5aec4824a"
                ],
                "x-istio-attributes": [
                    "CjMKGGRlc3RpbmF0aW9uLnNlcnZpY2UuaG9zdBIXEhVidmRnZGktc3ZkbWJhcDIuYnMuY2gKMwoYZGVzdGluYXRpb24uc2VydmljZS5uYW1lEhcSFWJ2ZGdkaS1zdmRtYmFwMi5icy5jaAoqCh1kZXN0aW5hdGlvbi5zZXJ2aWNlLm5hbWVzcGFjZRIJEgdkZWZhdWx0Ci4KE2Rlc3RpbmF0aW9uLnNlcnZpY2USFxIVYnZkZ2RpLXN2ZG1iYXAyLmJzLmNoCk8KCnNvdXJjZS51aWQSQRI/a3ViZXJuZXRlczovL2lzdGlvLWluZ3Jlc3NnYXRld2F5LTZmNTQ2OGZmYzktMmoyNmguaXN0aW8tc3lzdGVt"
                ],
                "accept-language": [
                    "de,en-US;q=0.7,en;q=0.3"
                ],
                "host": [
                    "map.geo.dev.bs.ch"
                ],
                "x-forwarded-for": [
                    "10.42.4.0"
                ],
                "accept": [
                    "application/json, text/plain, */*"
                ],
                "x-envoy-decorator-operation": [
                    "bvdgdi-svdmbap2.bs.ch:80/*"
                ],
                "te": [
                    "trailers"
                ],
                "user-agent": [
                    "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:67.0) Gecko/20100101 Firefox/67.0"
                ],
                "x-request-id": [
                    "bc91692b-1f31-4220-81e4-25d148ab93e5"
                ],
                "x-b3-traceid": [
                    "5595caa5aec4824a"
                ],
                "x-forwarded-proto": [
                    "https"
                ],
                "x-envoy-internal": [
                    "true"
                ],
                "cache-control": [
                    "no-cache"
                ],
                "cookie": [
                    "_pk_id.84.6428=2065899ef9b03ad0.1544686652.2.1544706137.1544705563.; AL_SESS-S=AZKUQBp6xyuz5NYW9Dulbs4hkSfjsitso2dcWkZCuwDX7nLzIPRxFYntTFukShH6apYj; AL_LB=$xc/GsIaerqoCH6abhJUNKphSEGRJYBVHKnC0xGk57Hm389fXSV3; AL_SESS=AU59TIaNx2aNNoD5oSrX8wrkafUYcLuAXZ6M4Te9VlOBTf0n2FXX3VVXOVIl8gHWPcX2; WEBROUTEID=.1; SRV=srv4; auth_tkt_mapbs_dev=52ca59af40f7487ada2e5ec06c19cccffa2de73c4921044b0874996578aa80c7a4f192b16d77170c1f5d3361d4430c00491e8cd0be7ef7be253020997d129f545cf6607cc3ZhcmVneA%3D%3D!userid_type:b64unicode; auth_tkt_mapbs_dev=52ca59af40f7487ada2e5ec06c19cccffa2de73c4921044b0874996578aa80c7a4f192b16d77170c1f5d3361d4430c00491e8cd0be7ef7be253020997d129f545cf6607cc3ZhcmVneA%3D%3D!userid_type:b64unicode"
                ],
                "x-b3-sampled": [
                    "0"
                ],
                "content-length": [
                    "6615"
                ],
                "accept-encoding": [
                    "gzip, deflate, br"
                ],
                "referer": [
                    "https://map.geo.dev.bs.ch/svareg/?lang=de&baselayer_ref=blank&map_x=2612746&map_y=1269372&map_zoom=8&rl_features=Fa(1kvuj-fkt7TzG2-gFr-gHt-pK6_g7-pAj-YN4!R8*3_DV7-kPy_bFu-fP1!s*7_7Cw-sRb!~n*Polygon%25201%27c*%2523DB4436%27a*0%27o*0.2%27m*true%27b*false%27s*10%27k*2)a(nnsuj-54t7T2-RaAJeAQrOj_6Sx_t3!cJ-2*f-t_f-v-1*Zf!D3Cs-9Bw-b!s-b_5_dHh_dP1!yCJsDL1Fy-kEb-dC_1Gq_sFHuD0qA1-hEd-9-Wy-F~n*Polygon%25202%27c*%2523DB4436%27a*0%27o*0.2%27m*true%27b*false%27s*10%27k*2)a(9tmuj-bgs7TPxA5-r_4-J8_Rm!Zv!EcE8-8AYpK8_cF*2Xx!Bv-g!Km!Oa!e-vBg!4*t-x*WtEc-aLGBzGTe*d-x_NWr-a-vL3T8*d_8_q_y_*h_g-bx!1N~n*Polygon%25203%27c*%2523DB4436%27a*0%27o*0.2%27m*true%27b*false%27s*10%27k*2)a(3yruj-5us7TjC!eB-zFp_pC-eE8-zEz-mL6-2V6*aB2-6_g-kZf*5Nf_sDVfIXqD1-nC7-wEw-~n*Polygon%25204%27c*%2523DB4436%27a*0%27o*0.2%27m*true%27b*false%27s*10%27k*2)&tree_enable_OF_Orthofoto2015April=false&tree_opacity_OF_Orthofoto2015April=0.69&tree_enable_OF_Orthofoto2010April=false&tree_enable_ch.swisstopo.swissimage-product-2011=false&tree_enable_OF_Orthofoto2012Maerz=false&tree_enable_OF_Orthofoto2012Juli=false&tree_enable_ch.swisstopo.swissimage-product-2014=false&tree_enable_OF_Orthofoto2017Maerz=false&tree_enable_OF_TrueOrthofoto2017Maerz=false&tree_enable_ch.swisstopo.swissimage-product=false&tree_groups=Luftmessstationen%20und%20Jahresmittelwerte%2CRaumbewirtschaftung%20Immobilien%20Basel-Stadt%2CLuft%2CAdministrative%20Einteilung%20Forstwirtschaft%2CLiegenschaften%2COrthofotos%20(ab%202010)&tree_group_layers_Luftmessstationen%20und%20Jahresmittelwerte=&tree_group_layers_Raumbewirtschaftung%20Immobilien%20Basel-Stadt=&tree_group_layers_Luft=&tree_group_layers_Administrative%20Einteilung%20Forstwirtschaft=&tree_group_layers_Liegenschaften="
                ]
            }
        },
        "disclaimer": "",
        "rotation": 0,
        "maxCommentLength": "120",
        "map": {
            "center": [
                2612746.125000001,
                1269371.875
            ],
            "scale": 1000,
            "rotation": 0,
            "projection": "EPSG:2056",
            "layers": [
                {
                    "style": {
                        "[_ngeo_style_0 = '1948']": {
                            "symbolizers": [
                                {
                                    "fillColor": "#db4436",
                                    "type": "polygon",
                                    "strokeColor": "#db4436",
                                    "fillOpacity": 0.2,
                                    "strokeOpacity": 1,
                                    "strokeWidth": 2
                                }
                            ]
                        },
                        "[_ngeo_style_1 = '1943']": {
                            "symbolizers": [
                                {
                                    "haloOpacity": 1,
                                    "fontColor": "#333333",
                                    "haloRadius": 1.5,
                                    "haloColor": "#ffffff",
                                    "label": "1'450 m²",
                                    "fontSize": "10pt",
                                    "type": "Text",
                                    "fontWeight": "normal",
                                    "conflictResolution": false,
                                    "labelXOffset": 0,
                                    "labelAlign": "cm",
                                    "fontFamily": "Arial",
                                    "labelYOffset": 0
                                }
                            ]
                        },
                        "[_ngeo_style_0 = '1946']": {
                            "symbolizers": [
                                {
                                    "fillColor": "#db4436",
                                    "type": "polygon",
                                    "strokeColor": "#db4436",
                                    "fillOpacity": 0.2,
                                    "strokeOpacity": 1,
                                    "strokeWidth": 2
                                }
                            ]
                        },
                        "[_ngeo_style_0 = '1942']": {
                            "symbolizers": [
                                {
                                    "fillColor": "#db4436",
                                    "type": "polygon",
                                    "strokeColor": "#db4436",
                                    "fillOpacity": 0.2,
                                    "strokeOpacity": 1,
                                    "strokeWidth": 2
                                }
                            ]
                        },
                        "[_ngeo_style_1 = '1947']": {
                            "symbolizers": [
                                {
                                    "haloOpacity": 1,
                                    "fontColor": "#333333",
                                    "haloRadius": 1.5,
                                    "haloColor": "#ffffff",
                                    "label": "2'900 m²",
                                    "fontSize": "10pt",
                                    "type": "Text",
                                    "fontWeight": "normal",
                                    "conflictResolution": false,
                                    "labelXOffset": 0,
                                    "labelAlign": "cm",
                                    "fontFamily": "Arial",
                                    "labelYOffset": 8
                                }
                            ]
                        },
                        "[_ngeo_style_1 = '1949']": {
                            "symbolizers": [
                                {
                                    "haloOpacity": 1,
                                    "fontColor": "#333333",
                                    "haloRadius": 1.5,
                                    "haloColor": "#ffffff",
                                    "label": "434 m²",
                                    "fontSize": "10pt",
                                    "type": "Text",
                                    "fontWeight": "normal",
                                    "conflictResolution": false,
                                    "labelXOffset": 0,
                                    "labelAlign": "cm",
                                    "fontFamily": "Arial",
                                    "labelYOffset": 0
                                }
                            ]
                        },
                        "[_ngeo_style_0 = '1944']": {
                            "symbolizers": [
                                {
                                    "fillColor": "#db4436",
                                    "type": "polygon",
                                    "strokeColor": "#db4436",
                                    "fillOpacity": 0.2,
                                    "strokeOpacity": 1,
                                    "strokeWidth": 2
                                }
                            ]
                        },
                        "[_ngeo_style_1 = '1945']": {
                            "symbolizers": [
                                {
                                    "haloOpacity": 1,
                                    "fontColor": "#333333",
                                    "haloRadius": 1.5,
                                    "haloColor": "#ffffff",
                                    "label": "2'150 m²",
                                    "fontSize": "10pt",
                                    "type": "Text",
                                    "fontWeight": "normal",
                                    "conflictResolution": false,
                                    "labelXOffset": 0,
                                    "labelAlign": "cm",
                                    "fontFamily": "Arial",
                                    "labelYOffset": 8
                                }
                            ]
                        },
                        "version": 2
                    },
                    "opacity": 1,
                    "geoJson": {
                        "features": [
                            {
                                "properties": {
                                    "_ngeo_style_0": "1942",
                                    "_ngeo_style_1": "1943",
                                    "s": 10,
                                    "b": false,
                                    "c": "#DB4436",
                                    "a": 0,
                                    "n": "Polygon 1",
                                    "o": 0.2,
                                    "m": true,
                                    "k": 2
                                },
                                "type": "Feature",
                                "geometry": {
                                    "type": "Polygon",
                                    "coordinates": [
                                        [
                                            [
                                                2613020.8000000003,
                                                1269431.1
                                            ],
                                            [
                                                2613001.6,
                                                1269429.4000000001
                                            ],
                                            [
                                                2612984.8000000003,
                                                1269426.6
                                            ],
                                            [
                                                2612964.8000000003,
                                                1269423.7000000002
                                            ],
                                            [
                                                2612939.7,
                                                1269420.2000000002
                                            ],
                                            [
                                                2612878.1,
                                                1269411.1
                                            ],
                                            [
                                                2612875.6,
                                                1269409.6
                                            ],
                                            [
                                                2612876.5,
                                                1269404.6
                                            ],
                                            [
                                                2612877.6,
                                                1269397.8
                                            ],
                                            [
                                                2612880.9000000004,
                                                1269398.2000000002
                                            ],
                                            [
                                                2612882.2,
                                                1269400.1
                                            ],
                                            [
                                                2612915.1,
                                                1269404.8
                                            ],
                                            [
                                                2612931.6,
                                                1269407.7000000002
                                            ],
                                            [
                                                2612964.3000000003,
                                                1269412.5
                                            ],
                                            [
                                                2612971.9000000004,
                                                1269416
                                            ],
                                            [
                                                2612983.4000000004,
                                                1269419
                                            ],
                                            [
                                                2613019.8000000003,
                                                1269424.3
                                            ],
                                            [
                                                2613020.8000000003,
                                                1269431.1
                                            ]
                                        ]
                                    ]
                                }
                            },
                            {
                                "properties": {
                                    "_ngeo_style_0": "1944",
                                    "_ngeo_style_1": "1945",
                                    "s": 10,
                                    "b": false,
                                    "c": "#DB4436",
                                    "a": 0,
                                    "n": "Polygon 2",
                                    "o": 0.2,
                                    "m": true,
                                    "k": 2
                                },
                                "type": "Feature",
                                "geometry": {
                                    "type": "Polygon",
                                    "coordinates": [
                                        [
                                            [
                                                2612871.4000000004,
                                                1269406.6
                                            ],
                                            [
                                                2612869.7,
                                                1269407.7000000002
                                            ],
                                            [
                                                2612861.2,
                                                1269408.4000000001
                                            ],
                                            [
                                                2612852.5,
                                                1269407.3
                                            ],
                                            [
                                                2612820.9000000004,
                                                1269403.2000000002
                                            ],
                                            [
                                                2612783.8000000003,
                                                1269398.5
                                            ],
                                            [
                                                2612625.7,
                                                1269375.5
                                            ],
                                            [
                                                2612625.6,
                                                1269369
                                            ],
                                            [
                                                2612627.9000000004,
                                                1269364.5
                                            ],
                                            [
                                                2612630.2,
                                                1269361.5
                                            ],
                                            [
                                                2612636.6,
                                                1269363
                                            ],
                                            [
                                                2612642.1,
                                                1269363.4000000001
                                            ],
                                            [
                                                2612653.4000000004,
                                                1269366.2000000002
                                            ],
                                            [
                                                2612663.4000000004,
                                                1269369.2000000002
                                            ],
                                            [
                                                2612668.7,
                                                1269372
                                            ],
                                            [
                                                2612672.4000000004,
                                                1269375.4000000001
                                            ],
                                            [
                                                2612692.2,
                                                1269379.4000000001
                                            ],
                                            [
                                                2612724.8000000003,
                                                1269384.2000000002
                                            ],
                                            [
                                                2612737.5,
                                                1269384.9000000001
                                            ],
                                            [
                                                2612751.5,
                                                1269385.7000000002
                                            ],
                                            [
                                                2612767.5,
                                                1269388.8
                                            ],
                                            [
                                                2612782.8000000003,
                                                1269390.9000000001
                                            ],
                                            [
                                                2612794.6,
                                                1269391
                                            ],
                                            [
                                                2612812.2,
                                                1269395.3
                                            ],
                                            [
                                                2612829.4000000004,
                                                1269395.9000000001
                                            ],
                                            [
                                                2612843.5,
                                                1269394.3
                                            ],
                                            [
                                                2612852.6,
                                                1269395.9000000001
                                            ],
                                            [
                                                2612867.8000000003,
                                                1269398.1
                                            ],
                                            [
                                                2612869.8000000003,
                                                1269396.7000000002
                                            ],
                                            [
                                                2612872.9000000004,
                                                1269397.2000000002
                                            ],
                                            [
                                                2612871.4000000004,
                                                1269406.6
                                            ]
                                        ]
                                    ]
                                }
                            },
                            {
                                "properties": {
                                    "_ngeo_style_0": "1946",
                                    "_ngeo_style_1": "1947",
                                    "s": 10,
                                    "b": false,
                                    "c": "#DB4436",
                                    "a": 0,
                                    "n": "Polygon 3",
                                    "o": 0.2,
                                    "m": true,
                                    "k": 2
                                },
                                "type": "Feature",
                                "geometry": {
                                    "type": "Polygon",
                                    "coordinates": [
                                        [
                                            [
                                                2612622.8000000003,
                                                1269374.9000000001
                                            ],
                                            [
                                                2612623.8000000003,
                                                1269365.4000000001
                                            ],
                                            [
                                                2612625.6,
                                                1269361
                                            ],
                                            [
                                                2612623.8000000003,
                                                1269361.7000000002
                                            ],
                                            [
                                                2612620.2,
                                                1269362.8
                                            ],
                                            [
                                                2612614.4000000004,
                                                1269364.3
                                            ],
                                            [
                                                2612608.2,
                                                1269363.8
                                            ],
                                            [
                                                2612593.2,
                                                1269361.8
                                            ],
                                            [
                                                2612584.8000000003,
                                                1269360.3
                                            ],
                                            [
                                                2612559.7,
                                                1269356.7000000002
                                            ],
                                            [
                                                2612543.1,
                                                1269356.9000000001
                                            ],
                                            [
                                                2612498.2,
                                                1269350.6
                                            ],
                                            [
                                                2612498.5,
                                                1269347.6
                                            ],
                                            [
                                                2612492.9000000004,
                                                1269346.8
                                            ],
                                            [
                                                2612487.1,
                                                1269345.8
                                            ],
                                            [
                                                2612481.8000000003,
                                                1269343.5
                                            ],
                                            [
                                                2612470.8000000003,
                                                1269337.9000000001
                                            ],
                                            [
                                                2612464.2,
                                                1269335
                                            ],
                                            [
                                                2612456.3000000003,
                                                1269333.6
                                            ],
                                            [
                                                2612440.6,
                                                1269331.4000000001
                                            ],
                                            [
                                                2612414.5,
                                                1269330.8
                                            ],
                                            [
                                                2612414.8000000003,
                                                1269311.6
                                            ],
                                            [
                                                2612416,
                                                1269304.5
                                            ],
                                            [
                                                2612418.2,
                                                1269299.8
                                            ],
                                            [
                                                2612419.1,
                                                1269298.4000000001
                                            ],
                                            [
                                                2612416.3000000003,
                                                1269296.3
                                            ],
                                            [
                                                2612389.3000000003,
                                                1269334.8
                                            ],
                                            [
                                                2612382.5,
                                                1269338.6
                                            ],
                                            [
                                                2612378.9000000004,
                                                1269342.9000000001
                                            ],
                                            [
                                                2612383.6,
                                                1269343.1
                                            ],
                                            [
                                                2612387.6,
                                                1269340.7000000002
                                            ],
                                            [
                                                2612588.1,
                                                1269369.5
                                            ],
                                            [
                                                2612622.8000000003,
                                                1269374.9000000001
                                            ]
                                        ]
                                    ]
                                }
                            },
                            {
                                "properties": {
                                    "_ngeo_style_0": "1948",
                                    "_ngeo_style_1": "1949",
                                    "s": 10,
                                    "b": false,
                                    "c": "#DB4436",
                                    "a": 0,
                                    "n": "Polygon 4",
                                    "o": 0.2,
                                    "m": true,
                                    "k": 2
                                },
                                "type": "Feature",
                                "geometry": {
                                    "type": "Polygon",
                                    "coordinates": [
                                        [
                                            [
                                                2612835.3000000003,
                                                1269392.2000000002
                                            ],
                                            [
                                                2612823.2,
                                                1269392
                                            ],
                                            [
                                                2612812.9000000004,
                                                1269391.9000000001
                                            ],
                                            [
                                                2612795.3000000003,
                                                1269387.6
                                            ],
                                            [
                                                2612783,
                                                1269387.5
                                            ],
                                            [
                                                2612767.9000000004,
                                                1269385.5
                                            ],
                                            [
                                                2612751.9000000004,
                                                1269382.3
                                            ],
                                            [
                                                2612725.3000000003,
                                                1269380.4000000001
                                            ],
                                            [
                                                2612683.6,
                                                1269373.7000000002
                                            ],
                                            [
                                                2612673.5,
                                                1269372
                                            ],
                                            [
                                                2612670,
                                                1269369.6
                                            ],
                                            [
                                                2612718.9000000004,
                                                1269376.7000000002
                                            ],
                                            [
                                                2612747.9000000004,
                                                1269380.6
                                            ],
                                            [
                                                2612761.9000000004,
                                                1269381.9000000001
                                            ],
                                            [
                                                2612783.4000000004,
                                                1269383.3
                                            ],
                                            [
                                                2612797.3000000003,
                                                1269384.9000000001
                                            ],
                                            [
                                                2612809.5,
                                                1269386.8
                                            ],
                                            [
                                                2612825.3000000003,
                                                1269389.8
                                            ],
                                            [
                                                2612835.3000000003,
                                                1269392.2000000002
                                            ]
                                        ]
                                    ]
                                }
                            }
                        ],
                        "type": "FeatureCollection"
                    },
                    "type": "geojson"
                }
            ],
            "dpi": 254
        },
        "lang": "de",
        "datasource": []
    }
}

The result is the following:

grafik

Actually, I'm expecting the second result even if we use a label offset.

Thanks,
Guillaume.

svareg added a commit to geoATbsPUNKTch/ngeo that referenced this issue Jun 7, 2019
@pvalsecc pvalsecc self-assigned this Nov 27, 2019
@pvalsecc
Copy link
Contributor

pvalsecc commented Nov 27, 2019

The problem is not that the 434 label overlaps the 2150 label. The conflictResolution is respected for that. But the problem comes with what geotools calls "goodness of fit". When a label for a polygon goes out of the polygon, geotools suppresses the label.

This is done in this piece of code:
https://github.com/geotools/geotools/blob/6ab5d012bd028a067bdfbaaeb3f35b9d3fb13c8f/modules/library/render/src/main/java/org/geotools/renderer/label/LabelCacheImpl.java#L1621-L1622

You can disable this feature by adding a 0 goodnessOfFit in your symbolizers. Something like that:

"symbolizers": [
                {
                  "haloOpacity": 1,
                  "fontColor": "#333333",
                  "haloRadius": 1.5,
                  "haloColor": "#ffffff",
                  "label": "434 m²",
                  "fontSize": "10pt",
                  "type": "Text",
                  "fontWeight": "normal",
                  "conflictResolution": false,
                  "labelXOffset": 0,
                  "labelAlign": "cm",
                  "fontFamily": "Arial",
                  "labelYOffset": 8,
                  "goodnessOfFit": 0.0
                }
              ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants