我的Shapefile基于几何作为点,功能类型作为名称,如汽车,公共汽车,飞机 .

我想基于类别明智地设置上面的图层,其中每个点应该显示SVG图像 .

我根据类别明智规则编写了以下SLD Style .

<?xml version="1.0" encoding="ISO-8859-1"?>
<StyledLayerDescriptor version="1.0.0"
 xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd"
 xmlns="http://www.opengis.net/sld"
 xmlns:ogc="http://www.opengis.net/ogc"
 xmlns:xlink="http://www.w3.org/1999/xlink"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <NamedLayer>
    <Name>VehicleLayer</Name>
    <UserStyle>
      <Title>VehicleStyle</Title>
      <FeatureTypeStyle>
        <Rule>
          <Name>Bus</Name>
          <Filter xmlns="http://www.opengis.net/ogc">
            <PropertyIsEqualTo>
              <PropertyName>name</PropertyName>
              <Literal>schoolbus</Literal>
            </PropertyIsEqualTo>
          </Filter>
            <PointSymbolizer>
              <Graphic>
                <ExternalGraphic>
                  <OnlineResource xlink:type="simple"
                  xlink:href="buses.svg" />
                  <Format>image/svg</Format>
                </ExternalGraphic>
              <Size>16</Size>
            </Graphic>
          </PointSymbolizer>
        </Rule>
        <Rule>
          <Name>Cars</Name>
          <Filter xmlns="http://www.opengis.net/ogc">
            <PropertyIsEqualTo>
              <PropertyName>name</PropertyName>
              <Literal>BMW</Literal>
            </PropertyIsEqualTo>
          </Filter>
            <PointSymbolizer>
              <Graphic>
                <ExternalGraphic>
                  <OnlineResource xlink:type="simple"
                  xlink:href="cars.svg" />
                  <Format>image/svg</Format>
                </ExternalGraphic>
              <Size>16</Size>
            </Graphic>
          </PointSymbolizer>
        </Rule>
        <Rule>
          <Name>Airplane</Name>
          <Filter xmlns="http://www.opengis.net/ogc">
            <PropertyIsEqualTo>
              <PropertyName>name</PropertyName>
              <Literal>kingfisher</Literal>
            </PropertyIsEqualTo>
          </Filter>
            <PointSymbolizer>
              <Graphic>
                <ExternalGraphic>
                  <OnlineResource xlink:type="simple"
                  xlink:href="airplane.svg" />
                  <Format>image/svg</Format>
                </ExternalGraphic>
              <Size>16</Size>
            </Graphic>
          </PointSymbolizer>
        </Rule>
      </FeatureTypeStyle>
    </UserStyle>
  </NamedLayer>
</StyledLayerDescriptor>

我将所有SVG图像(飞机,公共汽车,汽车)存储在GeoServer上的data_dir / styles文件夹中 .

和数据存储特征类型详细信息:

属性名称类型 - 字符串最小/最大出现 - 0/1

和名称包含以下值:

schoolbus1
kingfisher
schoolbus1
BMW

GeoServer日志:

Request: getServiceInfo
02 Oct 00:10:11 WARN [wms.map] - Failed to determine CRS axis order, assuming is EN
org.opengis.referencing.NoSuchAuthorityCodeException: No authority was defined for code "CRS:,DEF,CRS,EPSG,4326". Did you forget "AUTHORITY:NUMBER"?

02 Oct 00:10:11 INFO [geoserver.wms] -
Request: getMap
        Angle = 0.0
        BaseUrl = http://localhost:8080/geoserver/
        Bbox = SRSEnvelope[-180.0 : 180.0, -90.0 : 90.0]
        BgColor = java.awt.Color[r=255,g=255,b=255]
        Buffer = 0
        CQLFilter = null
        Crs = GEOGCS["WGS 84",
  DATUM["World Geodetic System 1984",
    SPHEROID["WGS 84", 6378137.0, 298.257223563, AUTHORITY["EPSG","7030"]],
    AUTHORITY["EPSG","6326"]],
  PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]],
  UNIT["degree", 0.017453292519943295],
  AXIS["Geodetic longitude", EAST],
  AXIS["Geodetic latitude", NORTH],
  AUTHORITY["EPSG","4326"]]
        Elevation = []
        Env = {}
        Exceptions = SE_XML
        FeatureId = null
        FeatureVersion = null
        Filter = null
        Filters = null
        Format = application/openlayers
        FormatOptions = {}
        Get = true
        Height = 384
        Interpolations = []
        Layers = [org.geoserver.wms.MapLayerInfo@59977e23]
        MaxFeatures = null
        Palette = null
        RawKvp = {REQUEST=GetMap, SRS=EPSG:4326, FORMAT=application/openlayers, BBOX=-180.0,-90.0,180.0,90.0, VERSION=1.1.0, STYLES=, SERVICE=WMS, WIDTH=768, HEIGHT=384, LAYERS=cite:VehicleLayer}
        RemoteOwsType = null
        RemoteOwsURL = null
        Request = GetMap
        RequestCharset = UTF-8
        ScaleMethod = null
        Sld = null
        SldBody = null
        SldVersion = null
        SRS = EPSG:4326
        StartIndex = null
        StyleBody = null
        StyleFormat = sld
        Styles = [StyleImpl[ name=VehicleStyle]]
        StyleUrl = null
        StyleVersion = null
        Tiled = false
        TilesOrigin = null
        Time = []
        Transparent = false
        ValidateSchema = false
        Version = 1.1.0
        ViewParams = null
        Width = 768

在输出中,我得到了小黑盒子 . output image

根据类别获得SVG图像结果的任何帮助 .

提前致谢 .