Geoserver伪三维SLD文件配置

作者: 拜拜都不行啊 | 来源:发表于2017-05-23 20:40 被阅读139次

一、效果图

面的伪三维效果

二、SLD文件配置

       <?xml version="1.0" encoding="ISO-8859-1"?>
         <StyledLayerDescriptor version="1.0.0"
         xsi:schemaLocation="http://www.opengis.net/sld              http://schemas.opengis.net/sld/1.0.0/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>3d</Name>
<UserStyle>
  <Title>A yellow polygon style</Title>
  <FeatureTypeStyle>
    <Rule>
      <Title>yellow polygon</Title>
      <PolygonSymbolizer>
         <Geometry>
          <ogc:Function name="isometric">
            <ogc:PropertyName>the_geom</ogc:PropertyName>
            <ogc:Literal>150</ogc:Literal>
          </ogc:Function>
        </Geometry>
        <Fill>
          <CssParameter name="fill">#7B8F96
          </CssParameter>
        </Fill>
        <Stroke>
          <CssParameter name="stroke">#000000</CssParameter>
          <CssParameter name="stroke-width">0.5</CssParameter>
        </Stroke>
      </PolygonSymbolizer>
       <PolygonSymbolizer>
        <Geometry>
          <ogc:Function name="offset">
            <ogc:PropertyName>the_geom</ogc:PropertyName>
            <ogc:Literal>0</ogc:Literal>
            <ogc:Literal>150</ogc:Literal>
          
          </ogc:Function>
        </Geometry>
        <Fill>
          <CssParameter name="fill">#BAD8E2</CssParameter>
          <CssParameter name="fill-opacity">1</CssParameter>
        </Fill>
    
      </PolygonSymbolizer>

    </Rule>

  </FeatureTypeStyle>
  </UserStyle>
 </NamedLayer>
</StyledLayerDescriptor>

三、参数说明

isometric参数说明

参数geometry就是指空间数据类型的字段名称,extrusion指拉伸面的长度。

offset参数说明

参数geometry就是指空间数据类型的字段名称,offseX左右偏移的值offseY值上下偏移。
四、问题总结
问题一:比如设置函数offset的X,Y偏移量,因为坐标系原因,你写的值太小比如0.001或者太大比如100000等,导致看不到这种效果,所以根据情况先慢慢增大Y值的偏移量看有没有伪三维的效果。
<code> <ogc:Literal>0</ogc:Literal>
<ogc:Literal>150</ogc:Literal> </code>
问题二:设置函数offset的偏移量Y值,但是没有和isometric函数的拉伸值保持一致,所以导致伪三维效果不好看,所以最好保持offset的Y值和isometric函数的拉伸值保持一致。
问题三:配色问题,一定要选好颜色,比如百度那种就不错,让人开起来想三维的。

相关文章

网友评论

    本文标题:Geoserver伪三维SLD文件配置

    本文链接:https://www.haomeiwen.com/subject/enugxxtx.html