GeoServer中使用SLD表现伪3D建筑

看到一篇博文,通过SLD来完成3D效果的,记得在OSM的站点上看到过这样的配置,还是值得一看的。转自:http://xml.iteye.com/blog/1666190


原文链接:pseudo-3D buildings in Geoserver 

Pseudo-3D or 2.5D or 3/4 perspective can be done in Geoserver using isometric function. 
 
Xml代码   收藏代码
  1. <FeatureTypeStyle>  
  2.   <Rule>  
  3.     <PolygonSymbolizer>  
  4.       <Geometry>  
  5.         <ogc:Function name="isometric">  
  6.           <ogc:PropertyName>geom</ogc:PropertyName>  
  7.           <ogc:Literal>7</ogc:Literal>  
  8.         </ogc:Function>  
  9.       </Geometry>  
  10.       <Fill>  
  11.         <CssParameter name="fill">#dddddd</CssParameter>  
  12.       </Fill>  
  13.       <Stroke>  
  14.         <CssParameter name="stroke">#999999</CssParameter>  
  15.       </Stroke>  
  16.     </PolygonSymbolizer>  
  17.   </Rule>  
  18. </FeatureTypeStyle>  
房顶的样式
Xml代码   收藏代码
  1. <FeatureTypeStyle>  
  2.   <Rule>  
  3.     <PolygonSymbolizer>  
  4.       <Geometry>  
  5.          <ogc:Function name="offset">  
  6.             <ogc:PropertyName>geom</ogc:PropertyName>  
  7.             <ogc:Literal>0</ogc:Literal>  
  8.             <ogc:Literal>7</ogc:Literal>  
  9.          </ogc:Function>  
  10.       </Geometry>  
  11.       <Fill>  
  12.         <CssParameter name="fill">#FFDCC7</CssParameter>  
  13.       </Fill>  
  14.       <Stroke>  
  15.         <CssParameter name="stroke">#999999</CssParameter>  
  16.       </Stroke>  
  17.     </PolygonSymbolizer>  
  18.   </Rule>  
  19. </FeatureTypeStyle>  
完整的例子
Xml代码   收藏代码
  1. <?xml version="1.0" encoding="ISO-8859-1"?>  
  2. <StyledLayerDescriptor version="1.0.0"   
  3.     xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd"   
  4.     xmlns="http://www.opengis.net/sld"   
  5.     xmlns:ogc="http://www.opengis.net/ogc"   
  6.     xmlns:xlink="http://www.w3.org/1999/xlink"   
  7.     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">  
  8.     <!-- a Named Layer is the basic building block of an SLD document -->  
  9.     <NamedLayer>  
  10.         <Name>default_polygon</Name>  
  11.         <UserStyle>  
  12.             <!-- Styles can have names, titles and abstracts -->  
  13.             <Title>Default Polygon</Title>  
  14.             <Abstract>A sample style that draws a polygon</Abstract>  
  15.             <!-- FeatureTypeStyles describe how to render different features -->  
  16.             <!-- A FeatureTypeStyle for rendering polygons -->  
  17.             <FeatureTypeStyle>  
  18.                 <Rule>  
  19.                     <PolygonSymbolizer>  
  20.                         <Geometry>  
  21.                             <ogc:Function name="isometric">  
  22.                                 <ogc:PropertyName>the_geom</ogc:PropertyName>  
  23.                                 <ogc:Literal>5</ogc:Literal>  
  24.                             </ogc:Function>  
  25.                         </Geometry>  
  26.                         <Fill>  
  27.                             <CssParameter name="fill">#dddddd</CssParameter>  
  28.                         </Fill>  
  29.                         <Stroke>  
  30.                             <CssParameter name="stroke">#999999</CssParameter>  
  31.                             <CssParameter name="stroke-width">0.1</CssParameter>  
  32.                         </Stroke>  
  33.                     </PolygonSymbolizer>  
  34.                 </Rule>  
  35.             </FeatureTypeStyle>  
  36.             <FeatureTypeStyle>  
  37.                 <Rule>  
  38.                     <PolygonSymbolizer>  
  39.                         <Geometry>  
  40.                             <ogc:Function name="offset">  
  41.                                 <ogc:PropertyName>the_geom</ogc:PropertyName>  
  42.                                 <ogc:Literal>0</ogc:Literal>  
  43.                                 <ogc:Literal>5</ogc:Literal>  
  44.                             </ogc:Function>  
  45.                         </Geometry>  
  46.                         <Fill>  
  47.                             <CssParameter name="fill">#cccccc</CssParameter>  
  48.                         </Fill>  
  49.                         <Stroke>  
  50.                             <CssParameter name="stroke">#999999</CssParameter>  
  51.                             <CssParameter name="stroke-width">0.1</CssParameter>  
  52.                         </Stroke>  
  53.                     </PolygonSymbolizer>  
  54.                 </Rule>  
  55.             </FeatureTypeStyle>  
  56.         </UserStyle>  
  57.     </NamedLayer>  
  58. </StyledLayerDescriptor>  
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 5
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值