Geoserver伪三维SLD文件配置

一、效果图

面的伪三维效果

二、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函数的拉伸值保持一致。
问题三:配色问题,一定要选好颜色,比如百度那种就不错,让人开起来想三维的。

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 134,915评论 18 139
  • Android 自定义View的各种姿势1 Activity的显示之ViewRootImpl详解 Activity...
    passiontim阅读 173,243评论 25 708
  • 第三章 管线一览 本章我们会学到什么 OpenGL管线的每个阶段做什么的 如果连接着色器和固定功能管线阶段 如果创...
    葭五阅读 6,320评论 2 18
  • Node.js Buffer(缓冲区) JavaScript 语言自身只有字符串数据类型,没有二进制数据类型。但在...
    FTOLsXD阅读 530评论 0 2
  • 今年夏天种了三株西红柿,青青的西红柿味道真是好闻。又翻出这篇旧作西红柿,夏天的阿拉斯加,真是除了蚊子,一切都好...
    阿拉斯加晴空阅读 343评论 0 1