0

I configured symbol systems for some polygon features in ArcMap, which include symbols with fill patterns and some symbols with slanted lines. I exported these symbol systems as LYR files, then converted them to QML using a QGIS conversion plugin. After importing the QML into QGIS and exporting the symbol systems as SLD files, I attempted to import the SLD files into GeoServer. However, I encountered following error message as shown in the screenshot below:

java.lang.RuntimeException: Parsing failed for href: javanet URiSyntaxException: Illegal character in authority at index 6: ttf://ESRI Cartography

[![enter image description here][1]][1]

After placing the relevant ESRI fonts in the 'style' folder of the symbol system workspace and modifying the configuration file syntax to eliminate syntax validation errors, the symbols are still not displaying correctly, as shown in the screenshot below.

[![enter image description here][2]][2]

[![enter image description here][3]][3]

The correct style for the legend is as follows:

enter image description here

I have also installed the ESRI font on the system where GeoServer is located, and through GeoServer's REST interface, I can see that the font is available, as shown in the screenshot below.

enter image description here

I'd like to know how I can correctly display the symbols configured in ArcMap. If replicating ArcGIS symbols isn't possible, what are the ways to achieve these symbols?

I attempted to modify the SLD and enabled Mark Factory Precedence for the corresponding workspace in the WMS service, but still couldn't achieve the desired symbols. The code is as follows:

<?xml version="1.0" encoding="UTF-8"?>
<StyledLayerDescriptor xmlns="http://www.opengis.net/sld" xmlns:se="http://www.opengis.net/se" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1.0" xsi:schemaLocation="http://www.opengis.net/sld http://schemas.opengis.net/sld/1.1.0/StyledLayerDescriptor.xsd">
  <NamedLayer>
    <se:Name>p6_治理恢复</se:Name>
    <UserStyle>
      <se:Name>p6_治理恢复</se:Name>
      <se:FeatureTypeStyle>
        <se:Rule>
          <se:Name>耕地恢复</se:Name>
          <se:Description>
            <se:Title>耕地恢复</se:Title>
          </se:Description>
          <ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">
            <ogc:PropertyIsEqualTo>
              <ogc:PropertyName>tblx</ogc:PropertyName>
              <ogc:Literal>耕地恢复</ogc:Literal>
            </ogc:PropertyIsEqualTo>
          </ogc:Filter>
          <se:PolygonSymbolizer>
            <se:Fill>
              <se:SvgParameter name="fill">#f8d072</se:SvgParameter>
            </se:Fill>
          </se:PolygonSymbolizer>
          <se:PolygonSymbolizer>
            <se:Fill>
              <se:GraphicFill>
                <se:Graphic>
                  <se:Mark>
                    <se:WellKnownName>ttf://ESRI Cartography#0xc8</se:WellKnownName>
                    <se:Fill>
                      <CssParameter name="fill">#FF0000</CssParameter>
                    </se:Fill>
                  </se:Mark>
                </se:Graphic>
              </se:GraphicFill>
            </se:Fill>
          </se:PolygonSymbolizer>
        </se:Rule>
      </se:FeatureTypeStyle>
    </UserStyle>
  </NamedLayer>
</StyledLayerDescriptor>

enter image description here 2023/9/18 Additional information provided for the question. This is the result when I comment out the 'filter' field in the SLD. enter image description here This is the display result of the point symbol I created. enter image description here Although the point symbol is displayed, the result is different from what is seen in QGIS. enter image description here

2 Answers 2

1

Your syntax is wrong - see the manual entry for TTF marks:

<Mark>
   <WellKnownName>ttf://Webdings#0x0064</WellKnownName>

The font needs to be installed on your system for Java to find it (not just dropped in the styles directory).

9
  • I am a bit confused. The SLD is generated by QGIS, so why is it not usable in GeoServer? Does QGIS and GeoServer have different standards for supporting SLD?
    – 苏云明
    Sep 14 at 3:28
  • I have provided test results in the issue. Please review.@Ian Turton
    – 苏云明
    Sep 14 at 7:09
  • TTF fonts as marks are an addition to the SLD specification and I have no idea why QGis would choose to implement it differently to GeoServer.
    – Ian Turton
    Sep 14 at 8:23
  • I've tested your SLD (with out the filter and with a different font as I don't have yours) and it works - though the CssParameter should be SvgParameter to make the color work. All I can suggest is that you turn logging up to GeoTools Developer and try again, then check the log file to see what GeoServer says is the problem
    – Ian Turton
    Sep 14 at 8:38
  • Alright, I'll test it again tomorrow as you suggested. I've noticed the time difference; it's already evening on my side.
    – 苏云明
    Sep 14 at 10:21
0

Thank you to @Ian Turton for answering my question. My issue has been resolved. I would like to add to Ian Turton's response.

1、To ensure that ESRI fonts are installed on GeoServer, you can verify it by accessing GeoServer's font API at this URL: http://192.168.40.161:8080/geoserver/rest/fonts. Please note that the installation method may vary between Java 8 and Java 11.

2、Symbols exported from QGIS may not necessarily match those in GeoServer, and there might be differences that require modification. For instance, when referencing fonts, GeoServer uses the <se:WellKnownName> tag, while QGIS may convert it to the <se:OnlineResource> tag.

Your Answer

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

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