阿拉伯标签在Geoserver中无法正确显示 [英] Arabic labels do not display correctly in Geoserver

查看:53
本文介绍了阿拉伯标签在Geoserver中无法正确显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我安装了与Tomcat一起安装的geoserver,文本标签显示不正确.我在哪里可以在geosever中设置阿拉伯语编码?标签在QGIS中显示得很好,但是当我在geoserver中发布标签时,出现了这个问题.

] 这是SLD:

 <?xml version ="1.0" encoding ="UTF-8"?>< sld:StyledLayerDescriptor xmlns ="http://www.opengis.net/sld" xmlns:sld ="http://www.opengis.net/sld" xmlns:ogc ="http://www.opengis.net/ogc"xmlns:gml =" http://www.opengis.net/gml"version =" 1.0.0>< sld:UserLayer>< sld:LayerFeatureConstraints>< sld:FeatureTypeConstraint/></sld:LayerFeatureConstraints>< sld:UserStyle>< sld:Name> sea</sld:Name>< sld:Title/>< sld:IsDefault> 1</sld:IsDefault>< sld:FeatureTypeStyle>< sld:Name>组0 lt;/sld:Name>< sld:FeatureTypeName>功能</sld:FeatureTypeName>< sld:SemanticTypeIdentifier>通用:几何</sld:SemanticTypeIdentifier>< sld:SemanticTypeIdentifier>简单</sld:SemanticTypeIdentifier>< sld:Rule>< sld:Name>默认规则</sld:Name>< sld:PolygonSymbolizer>< sld:Fill>< sld:CssParameter name =填充">#1B9E77</sld:CssParameter>< sld:CssParameter name =填充不透明度"> 0.5</sld:CssParameter></sld:Fill>< sld:Stroke>< sld:CssParameter name =笔划">#1B9E77</sld:CssParameter></sld:Stroke></sld:PolygonSymbolizer>< sld:TextSymbolizer>< sld:Label>< ogc:PropertyName>阿拉伯语</ogc:PropertyName></sld:Label>< sld:Font>< sld:CssParameter name ="font-family"> Arial</sld:CssParameter>< sld:CssParameter name =字体大小"> 12.0</sld:CssParameter>< sld:CssParameter name =字体样式">普通</sld:CssParameter>< sld:CssParameter name =字体重量">粗体</sld:CssParameter></sld:字体>< sld:LabelPlacement>< sld:PointPlacement>< sld:AnchorPoint>< sld:AnchorPointX> 0.5</sld:AnchorPointX>< sld:AnchorPointY> 0.5</sld:AnchorPointY></sld:AnchorPoint></sld:PointPlacement></sld:LabelPlacement>< sld:Fill>< sld:CssParameter name ="fill">#000000</sld:CssParameter></sld:Fill>< sld:VendorOption name ="spaceAround"> 2</sld:VendorOption></sld:TextSymbolizer></sld:Rule></sld:FeatureTypeStyle></sld:UserStyle></sld:UserLayer></sld:StyledLayerDescriptor> 

解决方案

最常见的问题是您未设置字符编码,请检查商店页面:

使用测试数据,我将其设置为"windows-1250"

切换到(以我为例)正确的"UTF-8"可以做到这一点,这是更好的选择.

最后使用比Arial(Trocchi)更好的字体来填写中文和阿拉伯字符.

更新

因此,尝试使用shapefile和SLD并使用"Windows阿拉伯字符集"进行谷歌搜索,使我将Shapefile数据存储区DBF字符集设置为"Windows-1256",这似乎可行.

I have geoserver installed with Tomcat and the text labeling do not display correctly . where can i set the Arabic encoding in geosever? the labeling appear well in QGIS but when i publish it in geoserver i get this problem .

]1

The shape file Here Is the SLD :

   <?xml version="1.0" encoding="UTF-8"?>
<sld:StyledLayerDescriptor xmlns="http://www.opengis.net/sld" xmlns:sld="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml" version="1.0.0">
    <sld:UserLayer>
        <sld:LayerFeatureConstraints>
            <sld:FeatureTypeConstraint/>
        </sld:LayerFeatureConstraints>
        <sld:UserStyle>
            <sld:Name>sea</sld:Name>
            <sld:Title/>
            <sld:IsDefault>1</sld:IsDefault>
            <sld:FeatureTypeStyle>
                <sld:Name>group 0</sld:Name>
                <sld:FeatureTypeName>Feature</sld:FeatureTypeName>
                <sld:SemanticTypeIdentifier>generic:geometry</sld:SemanticTypeIdentifier>
                <sld:SemanticTypeIdentifier>simple</sld:SemanticTypeIdentifier>
                <sld:Rule>
                    <sld:Name>default rule</sld:Name>
                    <sld:PolygonSymbolizer>
                        <sld:Fill>
                            <sld:CssParameter name="fill">#1B9E77</sld:CssParameter>
                            <sld:CssParameter name="fill-opacity">0.5</sld:CssParameter>
                        </sld:Fill>
                        <sld:Stroke>
                            <sld:CssParameter name="stroke">#1B9E77</sld:CssParameter>
                        </sld:Stroke>
                    </sld:PolygonSymbolizer>
                    <sld:TextSymbolizer>
                        <sld:Label>
                            <ogc:PropertyName>ARABIC</ogc:PropertyName>
                        </sld:Label>
                        <sld:Font>
                            <sld:CssParameter name="font-family">Arial</sld:CssParameter>
                            <sld:CssParameter name="font-size">12.0</sld:CssParameter>
                            <sld:CssParameter name="font-style">normal</sld:CssParameter>
                            <sld:CssParameter name="font-weight">bold</sld:CssParameter>
                        </sld:Font>
                        <sld:LabelPlacement>
                            <sld:PointPlacement>
                                <sld:AnchorPoint>
                                    <sld:AnchorPointX>0.5</sld:AnchorPointX>
                                    <sld:AnchorPointY>0.5</sld:AnchorPointY>
                                </sld:AnchorPoint>
                            </sld:PointPlacement>
                        </sld:LabelPlacement>
                        <sld:Fill>
                            <sld:CssParameter name="fill">#000000</sld:CssParameter>
                        </sld:Fill>
                        <sld:VendorOption name="spaceAround">2</sld:VendorOption>
                    </sld:TextSymbolizer>
                </sld:Rule>
            </sld:FeatureTypeStyle>
        </sld:UserStyle>
    </sld:UserLayer>
</sld:StyledLayerDescriptor>

解决方案

The most common problem is that you have miss set the character encoding, check the store page:

With my test data I get this with a setting of "windows-1250"

Switching to the (in my case) correct "UTF-8" gives this, which is better.

And finally using a "better" font than Arial (Trocchi) fills out the Chinese as well as the Arabic characters.

Update

So experimenting with your shapefile and SLD and googling "windows arabic character set" led me to setting the Shapefile datastore DBF character set to "Windows-1256" which seems to work.

这篇关于阿拉伯标签在Geoserver中无法正确显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆