zoukankan      html  css  js  c++  java
  • GeoServer sld加载图片style

    1. 将图片复制到对应工作区的style文件夹中,如我在giswork的工作区下新增style,图片路径如下:/opt/apache-tomcat-8.5.54/webapps/geoserver/data/workspaces/giswork/styles

    2. 新增styles,sld代码如下:图片路径配置在<OnlineResource>标签下
      如果图片相对于GeoServer安装目录/data/workspaces/styles 的相对路径。例如 xlink:href="images/famen.png" ,那么就需要把图片放在/data/workspaces/giswork/styles/images文件夹下

    <?xml version="1.0" encoding="UTF-8"?>
    <sld:StyledLayerDescriptor xmlns="http://www.opengis.net/sld"
    xmlns:sld="http://www.opengis.net/sld"
    xmlns:gml="http://www.opengis.net/gml"
    xmlns:ogc="http://www.opengis.net/ogc"
    version="1.0.0">
    <sld:UserLayer>
    <sld:LayerFeatureConstraints>
    <sld:FeatureTypeConstraint/>
    </sld:LayerFeatureConstraints>
    <sld:UserStyle>
    <sld:Name>LN09441_L_PNT</sld:Name>
    <sld:Title>LN09441_L_PNT</sld:Title>
    <sld:Abstract/>
    <sld:FeatureTypeStyle>
    <sld:Name>default</sld:Name>
    <sld:Title/>
    <sld:Abstract/>
    <sld:FeatureTypeName>Feature</sld:FeatureTypeName>
    <sld:SemanticTypeIdentifier>generic:geometry</sld:SemanticTypeIdentifier>
    <sld:SemanticTypeIdentifier>simple</sld:SemanticTypeIdentifier>
    <sld:Rule>
    <sld:Name>default</sld:Name>
    <sld:Title/>
    <sld:Abstract/>
    <sld:PointSymbolizer>
    <sld:Graphic>
    <ExternalGraphic>
    <OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="famen.png"/>
    <Format>image/png</Format>
    </ExternalGraphic>
    <sld:Mark>
    <sld:WellKnownName>circle</sld:WellKnownName>
    <sld:Stroke/>
    </sld:Mark>
    <sld:Size>8.000000px</sld:Size>
    <sld:Rotation>0.0</sld:Rotation>
    </sld:Graphic>
    </sld:PointSymbolizer>
    <sld:TextSymbolizer/>
    </sld:Rule>
    </sld:FeatureTypeStyle>
    </sld:UserStyle>
    </sld:UserLayer>
    </sld:StyledLayerDescriptor>
    
  • 相关阅读:
    swoole 安装方法 使用即时聊天
    git的介绍以及简单应用
    curl的应用
    linux下监听和同步代码配置
    mac skim 修改背景色
    php 编译安装的一个 configure 配置
    mac mysql error You must reset your password using ALTER USER statement before executing this statement.
    yii2 控制器里 action 大小写组合造成的路由问题
    warning : json_decode(): option JSON_BIGINT_AS_STRING not implemented in xxx
    redis 自启动脚本
  • 原文地址:https://www.cnblogs.com/giser-s/p/13072342.html
Copyright © 2011-2022 走看看