GeoServer中使用SLD表現偽3D建築
阿新 • • 發佈:2019-02-15
看到一篇博文,通過SLD來完成3D效果的,記得在OSM的站點上看到過這樣的配置,還是值得一看的。轉自:http://xml.iteye.com/blog/1666190
Pseudo-3D or 2.5D or 3/4 perspective can be done in Geoserver using isometric function.Xml程式碼
- <FeatureTypeStyle>
- <Rule>
- <PolygonSymbolizer>
- <Geometry>
-
<ogc:Function
- <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>
-
<
- <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>