看到一篇博文,通过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.![](http://dl.iteye.com/upload/attachment/0073/0073/00ad3652-4d8c-3624-bdf0-933d6f8519c7.png)
- <FeatureTypeStyle>
- <Rule>
- <PolygonSymbolizer>
- <Geometry>
- <ogc:Function name="isometric">
- <ogc:PropertyName>geom</ogc:PropertyName>
- <ogc:Literal>7</ogc:Literal>
- </ogc:Function>
- </Geometry>
- <Fill>
- <CssParameter name="fill">#dddddd</CssParameter>
- </Fill>
- <Stroke>
- <CssParameter name="stroke">#999999</CssParameter>
- </Stroke>
- </PolygonSymbolizer>
- </Rule>
- </FeatureTypeStyle>
- <FeatureTypeStyle>
- <Rule>
- <PolygonSymbolizer>
- <Geometry>
- <ogc:Function name="offset">
- <ogc:PropertyName>geom</ogc:PropertyName>
- <ogc:Literal>0</ogc:Literal>
- <ogc:Literal>7</ogc:Literal>
- </ogc:Function>
- </Geometry>
- <Fill>
- <CssParameter name="fill">#FFDCC7</CssParameter>
- </Fill>
- <Stroke>
- <CssParameter name="stroke">#999999</CssParameter>
- </Stroke>
- </PolygonSymbolizer>
- </Rule>
- </FeatureTypeStyle>
- <?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">
- <!-- a Named Layer is the basic building block of an SLD document -->
- <NamedLayer>
- <Name>default_polygon</Name>
- <UserStyle>
- <!-- Styles can have names, titles and abstracts -->
- <Title>Default Polygon</Title>
- <Abstract>A sample style that draws a polygon</Abstract>
- <!-- FeatureTypeStyles describe how to render different features -->
- <!-- A FeatureTypeStyle for rendering polygons -->
- <FeatureTypeStyle>
- <Rule>
- <PolygonSymbolizer>
- <Geometry>
- <ogc:Function name="isometric">
- <ogc:PropertyName>the_geom</ogc:PropertyName>
- <ogc:Literal>5</ogc:Literal>
- </ogc:Function>
- </Geometry>
- <Fill>
- <CssParameter name="fill">#dddddd</CssParameter>
- </Fill>
- <Stroke>
- <CssParameter name="stroke">#999999</CssParameter>
- <CssParameter name="stroke-width">0.1</CssParameter>
- </Stroke>
- </PolygonSymbolizer>
- </Rule>
- </FeatureTypeStyle>
- <FeatureTypeStyle>
- <Rule>
- <PolygonSymbolizer>
- <Geometry>
- <ogc:Function name="offset">
- <ogc:PropertyName>the_geom</ogc:PropertyName>
- <ogc:Literal>0</ogc:Literal>
- <ogc:Literal>5</ogc:Literal>
- </ogc:Function>
- </Geometry>
- <Fill>
- <CssParameter name="fill">#cccccc</CssParameter>
- </Fill>
- <Stroke>
- <CssParameter name="stroke">#999999</CssParameter>
- <CssParameter name="stroke-width">0.1</CssParameter>
- </Stroke>
- </PolygonSymbolizer>
- </Rule>
- </FeatureTypeStyle>
- </UserStyle>
- </NamedLayer>
- </StyledLayerDescriptor>